package com.sanmubird.mywebframework.app;

import com.alibaba.fastjson.JSONObject;
import com.sanmubird.mywebframework.indicator.domain.ability.IndicatorAbility;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author sam
 * @date 2021/10/11 18:20
 */
@RestController
@RequestMapping("/apply")
public class ApplyController {

    private static final Logger LOGGER = LoggerFactory.getLogger(ApplyController.class);

    @Autowired
    private IndicatorAbility indicatorAbility;

    @PostMapping("/demo/{code}")
    public JSONObject demo(@PathVariable String code, @RequestBody JSONObject params) {
        return indicatorAbility.getIndicatorData(code, params);
    }

    @GetMapping("/demo/{code}")
    public String test(@PathVariable String code) {
        LOGGER.info(code);
        return code;
    }


}
